﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="editUser.aspx.cs" Inherits="NCC_SOP.Admin.editUser" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
 <style type="text/css">
        .required
        {
            color: Red;
        }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:MultiView runat="server" ID="MultiView1">
        <asp:View ID="EditUserView" runat="server">
            <asp:Table ID="UserInfoTable" runat="server" Width="272px">
                <asp:TableRow>
                    <asp:TableCell HorizontalAlign="Right">User Name:</asp:TableCell>
                    <asp:TableCell>
                        <asp:TextBox ID="UserNameBox" runat="server" Enabled="false"></asp:TextBox></asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell HorizontalAlign="Right">Email:</asp:TableCell><asp:TableCell>
                        <asp:TextBox ID="EmailBox" runat="server"></asp:TextBox>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell HorizontalAlign="Right">Page Roles:    
                    </asp:TableCell><asp:TableCell>
                    <asp:RadioButtonList ID="PageRoleList" runat="server"></asp:RadioButtonList>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell HorizontalAlign="Right">Report Roles:    
                    </asp:TableCell><asp:TableCell>
                        <asp:CheckBoxList ID="ReportRoleList" runat="server">
                        </asp:CheckBoxList>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell HorizontalAlign="Right">Report Depamrtents:    
                    </asp:TableCell><asp:TableCell>
                        <asp:CheckBoxList ID="DepartmentList" runat="server" RepeatColumns="4" Width="400px">
                        </asp:CheckBoxList>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell HorizontalAlign="Right">Active User:</asp:TableCell><asp:TableCell>
                        <asp:RadioButtonList ID="ActiveUserList" runat="server">
                        </asp:RadioButtonList>
                    </asp:TableCell></asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell HorizontalAlign="Right">Locked Out:</asp:TableCell>
                    <asp:TableCell>
                        <asp:Label runat="server" ID="LastLockoutDate"></asp:Label></asp:TableCell>
                    <asp:TableCell HorizontalAlign="Left">
                        <asp:Button ID="UnlockUserButton" runat="server" Text="Unlock User" OnClick="UnlockUserButton_Click"></asp:Button></asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell ColumnSpan="3">
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="required" runat="server" ControlToValidate="EmailBox"
                            ErrorMessage="Email Address Required." ValidationGroup="EditUser">
                        </asp:RequiredFieldValidator>
                       </asp:TableCell>
                       
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell ColumnSpan="3">
                     <asp:RegularExpressionValidator ID="RegularExpressionValidator1" CssClass="required" runat="server" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                            ControlToValidate="EmailBox" ErrorMessage="Please enter a valid email address." ValidationGroup="EditUser">  
                        </asp:RegularExpressionValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                <asp:TableCell ColumnSpan="3">
                <asp:CustomValidator ID="cv" runat="server" CssClass="required" ErrorMessage="Please select at least 1 Page Role and 1 Report Role." OnServerValidate="ValidateRole" ValidationGroup="EditUser"></asp:CustomValidator>
                </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell ColumnSpan="2" HorizontalAlign="Right">
                        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" ValidationGroup="EditUser" Text="Save" CausesValidation="true"/>
                        <asp:Button ID="Button2" runat="server" OnClick="redirectToManageUser" Text="Cancel"
                            CausesValidation="false" /></asp:TableCell></asp:TableRow>
            </asp:Table>
        </asp:View>
        <asp:View ID="EditSuccess" runat="server">
            <table>
                <tr>
                    <td>
                        <asp:Label ID="EditSuccessLabel" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:LinkButton ID="EditSuccessGoBackButton" runat="server" OnClick="redirectToManageUser"
                            Text="Click here to go back to Manage Users." />
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
</asp:Content>
